package top.kaoshanji.p1ch05e.config;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import top.kaoshanji.p1ch05e.services.CommentService;

/**
 * @author kaoshanji
 * ^_^
 * create time 2025/4/27 20:47
 */
@Configuration
public class ProjectConfig {

    /**
     * 代码清单-p1ch05e-101页b：声明原型作用域的bean
     * @return CommentService
     */
    @Bean
    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    public CommentService commentService() {
        return new CommentService();
    }

}
